from flask import current_app

from app.models.bo.gaolu.gaolu_reason_status_bo import GaoLuReasonStatusBO
from app.services.models.base_model import BaseModel


class GaoLuReasonModel(BaseModel):
    def __init__(self):
        super().__init__(model_name="gaolu_reason_model")

    def process(self, gaolu_reason_input_bo):
        try:
            CG_LT_GL_GL04_COZXFX = gaolu_reason_input_bo.CG_LT_GL_GL04_COZXFX
            CG_LT_GL_GL04_CO2ZXFX = gaolu_reason_input_bo.CG_LT_GL_GL04_CO2ZXFX
            CG_LT_GL_GL04_H2ZXZF = gaolu_reason_input_bo.CG_LT_GL_GL04_H2ZXZF
            CG_LT_GL_GL04_N2ZXZF = gaolu_reason_input_bo.CG_LT_GL_GL04_N2ZXZF
            CG_LT_GL_GL04_MQLYL = gaolu_reason_input_bo.CG_LT_GL_GL04_MQLYL
            CG_LT_GL_GL04_FSBZ = gaolu_reason_input_bo.CG_LT_GL_GL04_FSBZ
            CG_LT_GL_GL04_LDWD01 = gaolu_reason_input_bo.CG_LT_GL_GL04_LDWD01
            CG_LT_GL_GL04_LDWD02 = gaolu_reason_input_bo.CG_LT_GL_GL04_LDWD02
            CG_LT_GL_GL04_LDWD03 = gaolu_reason_input_bo.CG_LT_GL_GL04_LDWD03
            CG_LT_GL_GL04_LDWD04 = gaolu_reason_input_bo.CG_LT_GL_GL04_LDWD04
            CG_LT_GL_GL04_DW = gaolu_reason_input_bo.CG_LT_GL_GL04_DW
            CG_LT_GL_GL04_JSWD = gaolu_reason_input_bo.CG_LT_GL_GL04_JSWD
            CG_LT_GL_GL04_GFDNKG = gaolu_reason_input_bo.CG_LT_GL_GL04_GFDNKG
            CG_LT_GL_GL04_FYLL = gaolu_reason_input_bo.CG_LT_GL_GL04_FYLL
            CG_LT_GL_GL04_ZXQL = gaolu_reason_input_bo.CG_LT_GL_GL04_ZXQL
            CG_LT_GL_GL04_FZWD = gaolu_reason_input_bo.CG_LT_GL_GL04_FZWD
            CG_LT_GL_GL04_LFLL = gaolu_reason_input_bo.CG_LT_GL_GL04_LFLL
            CG_LT_GL_GL04_LFYL = gaolu_reason_input_bo.CG_LT_GL_GL04_LFYL
            CG_LT_GL_GL04_YC = gaolu_reason_input_bo.CG_LT_GL_GL04_YC
            CG_LT_GL_GL04_LDYL = gaolu_reason_input_bo.CG_LT_GL_GL04_LDYL
            CG_LT_GL_GL04_RFWD = gaolu_reason_input_bo.CG_LT_GL_GL04_RFWD
            CG_LT_GL_GL04_RFYL02 = gaolu_reason_input_bo.CG_LT_GL_GL04_RFYL02
            CG_LT_GL_GL04_RFH = gaolu_reason_input_bo.CG_LT_GL_GL04_RFH
            CG_LT_GL_GL04_FSSJ = gaolu_reason_input_bo.CG_LT_GL_GL04_FSSJ
            CG_LT_GL_GL04_SBYC = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYC
            CG_LT_GL_GL04_SBYCZB = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYCZB
            CG_LT_GL_GL04_SBYC04 = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYC04
            CG_LT_GL_GL04_SBYC03 = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYC03
            CG_LT_GL_GL04_SBYC02 = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYC02
            CG_LT_GL_GL04_SBYC01 = gaolu_reason_input_bo.CG_LT_GL_GL04_SBYC01
            CG_LT_GL_GL04_GLRSZLL = gaolu_reason_input_bo.CG_LT_GL_GL04_GLRSZLL
            CG_LT_GL_GL04_ZBYCZB = gaolu_reason_input_bo.CG_LT_GL_GL04_ZBYCZB
            CG_LT_GL_GL04_TQXZS = gaolu_reason_input_bo.CG_LT_GL_GL04_TQXZS
            CG_LT_GL_GL04_XBYC = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYC
            CG_LT_GL_GL04_XBYCZB = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYCZB
            CG_LT_GL_GL04_XBYC01 = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYC01
            CG_LT_GL_GL04_XBYC02 = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYC02
            CG_LT_GL_GL04_XBYC03 = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYC03
            CG_LT_GL_GL04_XBYC04 = gaolu_reason_input_bo.CG_LT_GL_GL04_XBYC04
            CG_LT_GL_GL04_FCokeRate = gaolu_reason_input_bo.CG_LT_GL_GL04_FCokeRate
            CG_LT_GL_GL04_FCoalRate = gaolu_reason_input_bo.CG_LT_GL_GL04_FCoalRate
            CG_LT_GL_GL04_RLB = gaolu_reason_input_bo.CG_LT_GL_GL04_RLB
            CG_LT_GL_GL04_V = gaolu_reason_input_bo.CG_LT_GL_GL04_V
            CG_LT_GL_GL04_Si_Ti = gaolu_reason_input_bo.CG_LT_GL_GL04_Si_Ti
            CG_LT_GL_GL04_Ftswd = gaolu_reason_input_bo.CG_LT_GL_GL04_Ftswd
            CG_LT_GL_GL04_FLiLunTie = gaolu_reason_input_bo.CG_LT_GL_GL04_FLiLunTie

            CG_LT_GL_GL04_COZXFX_status = self._get_CG_LT_GL_GL04_COZXFX_status(CG_LT_GL_GL04_COZXFX)
            CG_LT_GL_GL04_CO2ZXFX_status = self._get_CG_LT_GL_GL04_CO2ZXFX_status(CG_LT_GL_GL04_CO2ZXFX)
            CG_LT_GL_GL04_H2ZXZF_status = self._get_CG_LT_GL_GL04_H2ZXZF_status(CG_LT_GL_GL04_H2ZXZF)
            CG_LT_GL_GL04_N2ZXZF_status = self._get_CG_LT_GL_GL04_N2ZXZF_status(CG_LT_GL_GL04_N2ZXZF)
            CG_LT_GL_GL04_MQLYL_status = self._get_CG_LT_GL_GL04_MQLYL_status(CG_LT_GL_GL04_MQLYL)
            CG_LT_GL_GL04_FSBZ_status = self._get_CG_LT_GL_GL04_FSBZ_status(CG_LT_GL_GL04_FSBZ)
            CG_LT_GL_GL04_LDWD01_status = self._get_CG_LT_GL_GL04_LDWD01_status(CG_LT_GL_GL04_LDWD01)
            CG_LT_GL_GL04_LDWD02_status = self._get_CG_LT_GL_GL04_LDWD02_status(CG_LT_GL_GL04_LDWD02)
            CG_LT_GL_GL04_LDWD03_status = self._get_CG_LT_GL_GL04_LDWD03_status(CG_LT_GL_GL04_LDWD03)
            CG_LT_GL_GL04_LDWD04_status = self._get_CG_LT_GL_GL04_LDWD04_status(CG_LT_GL_GL04_LDWD04)
            CG_LT_GL_GL04_DW_status = self._get_CG_LT_GL_GL04_DW_status(CG_LT_GL_GL04_DW)
            CG_LT_GL_GL04_JSWD_status = self._get_CG_LT_GL_GL04_JSWD_status(CG_LT_GL_GL04_JSWD)
            CG_LT_GL_GL04_GFDNKG_status = self._get_CG_LT_GL_GL04_GFDNKG_status(CG_LT_GL_GL04_GFDNKG)
            CG_LT_GL_GL04_FYLL_status = self._get_CG_LT_GL_GL04_FYLL_status(CG_LT_GL_GL04_FYLL)
            CG_LT_GL_GL04_ZXQL_status = self._get_CG_LT_GL_GL04_ZXQL_status(CG_LT_GL_GL04_ZXQL)
            CG_LT_GL_GL04_FZWD_status = self._get_CG_LT_GL_GL04_FZWD_status(CG_LT_GL_GL04_FZWD)
            CG_LT_GL_GL04_LFLL_status = self._get_CG_LT_GL_GL04_LFLL_status(CG_LT_GL_GL04_LFLL)
            CG_LT_GL_GL04_LFYL_status = self._get_CG_LT_GL_GL04_LFYL_status(CG_LT_GL_GL04_LFYL)
            CG_LT_GL_GL04_YC_status = self._get_CG_LT_GL_GL04_YC_status(CG_LT_GL_GL04_YC)
            CG_LT_GL_GL04_LDYL_status = self._get_CG_LT_GL_GL04_LDYL_status(CG_LT_GL_GL04_LDYL)
            CG_LT_GL_GL04_RFWD_status = self._get_CG_LT_GL_GL04_RFWD_status(CG_LT_GL_GL04_RFWD)
            CG_LT_GL_GL04_RFYL02_status = self._get_CG_LT_GL_GL04_RFYL02_status(CG_LT_GL_GL04_RFYL02)
            CG_LT_GL_GL04_RFH_status = self._get_CG_LT_GL_GL04_RFH_status(CG_LT_GL_GL04_RFH)
            CG_LT_GL_GL04_FSSJ_status = self._get_CG_LT_GL_GL04_FSSJ_status(CG_LT_GL_GL04_FSSJ)
            CG_LT_GL_GL04_SBYC_status = self._get_CG_LT_GL_GL04_SBYC_status(CG_LT_GL_GL04_SBYC)
            CG_LT_GL_GL04_SBYCZB_status = self._get_CG_LT_GL_GL04_SBYCZB_status(CG_LT_GL_GL04_SBYCZB)
            CG_LT_GL_GL04_SBYC04_status = self._get_CG_LT_GL_GL04_SBYC04_status(CG_LT_GL_GL04_SBYC04)
            CG_LT_GL_GL04_SBYC03_status = self._get_CG_LT_GL_GL04_SBYC03_status(CG_LT_GL_GL04_SBYC03)
            CG_LT_GL_GL04_SBYC02_status = self._get_CG_LT_GL_GL04_SBYC02_status(CG_LT_GL_GL04_SBYC02)
            CG_LT_GL_GL04_SBYC01_status = self._get_CG_LT_GL_GL04_SBYC01_status(CG_LT_GL_GL04_SBYC01)
            CG_LT_GL_GL04_GLRSZLL_status = self._get_CG_LT_GL_GL04_GLRSZLL_status(CG_LT_GL_GL04_GLRSZLL)
            CG_LT_GL_GL04_ZBYCZB_status = self._get_CG_LT_GL_GL04_ZBYCZB_status(CG_LT_GL_GL04_ZBYCZB)
            CG_LT_GL_GL04_TQXZS_status = self._get_CG_LT_GL_GL04_TQXZS_status(CG_LT_GL_GL04_TQXZS)
            CG_LT_GL_GL04_XBYC_status = self._get_CG_LT_GL_GL04_XBYC_status(CG_LT_GL_GL04_XBYC)
            CG_LT_GL_GL04_XBYCZB_status = self._get_CG_LT_GL_GL04_XBYCZB_status(CG_LT_GL_GL04_XBYCZB)
            CG_LT_GL_GL04_XBYC01_status = self._get_CG_LT_GL_GL04_XBYC01_status(CG_LT_GL_GL04_XBYC01)
            CG_LT_GL_GL04_XBYC02_status = self._get_CG_LT_GL_GL04_XBYC02_status(CG_LT_GL_GL04_XBYC02)
            CG_LT_GL_GL04_XBYC03_status = self._get_CG_LT_GL_GL04_XBYC03_status(CG_LT_GL_GL04_XBYC03)
            CG_LT_GL_GL04_XBYC04_status = self._get_CG_LT_GL_GL04_XBYC04_status(CG_LT_GL_GL04_XBYC04)
            CG_LT_GL_GL04_FCokeRate_status = self._get_CG_LT_GL_GL04_FCokeRate_status(CG_LT_GL_GL04_FCokeRate)
            CG_LT_GL_GL04_FCoalRate_status = self._get_CG_LT_GL_GL04_FCoalRate_status(CG_LT_GL_GL04_FCoalRate)
            CG_LT_GL_GL04_RLB_status = self._get_CG_LT_GL_GL04_RLB_status(CG_LT_GL_GL04_RLB)
            CG_LT_GL_GL04_V_status = self._get_CG_LT_GL_GL04_V_status(CG_LT_GL_GL04_V)
            CG_LT_GL_GL04_Si_Ti_status = self._get_CG_LT_GL_GL04_Si_Ti_status(CG_LT_GL_GL04_Si_Ti)
            CG_LT_GL_GL04_Ftswd_status = self._get_CG_LT_GL_GL04_Ftswd_status(CG_LT_GL_GL04_Ftswd)
            CG_LT_GL_GL04_FLiLunTie_status = self._get_CG_LT_GL_GL04_FLiLunTie_status(CG_LT_GL_GL04_FLiLunTie)

            # status: 1: 失分项-低于（异常） 2: 失分项-低于 3: 正常 4: 失分项-高于 5: 失分项-高于（异常）0 异常值
            gaolu_reason_status_bo = GaoLuReasonStatusBO(CG_LT_GL_GL04_COZXFX_status=CG_LT_GL_GL04_COZXFX_status,
                                                         CG_LT_GL_GL04_CO2ZXFX_status=CG_LT_GL_GL04_CO2ZXFX_status,
                                                         CG_LT_GL_GL04_H2ZXZF_status=CG_LT_GL_GL04_H2ZXZF_status,
                                                         CG_LT_GL_GL04_N2ZXZF_status=CG_LT_GL_GL04_N2ZXZF_status,
                                                         CG_LT_GL_GL04_MQLYL_status=CG_LT_GL_GL04_MQLYL_status,
                                                         CG_LT_GL_GL04_FSBZ_status=CG_LT_GL_GL04_FSBZ_status,
                                                         CG_LT_GL_GL04_LDWD01_status=CG_LT_GL_GL04_LDWD01_status,
                                                         CG_LT_GL_GL04_LDWD02_status=CG_LT_GL_GL04_LDWD02_status,
                                                         CG_LT_GL_GL04_LDWD03_status=CG_LT_GL_GL04_LDWD03_status,
                                                         CG_LT_GL_GL04_LDWD04_status=CG_LT_GL_GL04_LDWD04_status,
                                                         CG_LT_GL_GL04_DW_status=CG_LT_GL_GL04_DW_status,
                                                         CG_LT_GL_GL04_JSWD_status=CG_LT_GL_GL04_JSWD_status,
                                                         CG_LT_GL_GL04_GFDNKG_status=CG_LT_GL_GL04_GFDNKG_status,
                                                         CG_LT_GL_GL04_FYLL_status=CG_LT_GL_GL04_FYLL_status,
                                                         CG_LT_GL_GL04_ZXQL_status=CG_LT_GL_GL04_ZXQL_status,
                                                         CG_LT_GL_GL04_FZWD_status=CG_LT_GL_GL04_FZWD_status,
                                                         CG_LT_GL_GL04_LFLL_status=CG_LT_GL_GL04_LFLL_status,
                                                         CG_LT_GL_GL04_LFYL_status=CG_LT_GL_GL04_LFYL_status,
                                                         CG_LT_GL_GL04_YC_status=CG_LT_GL_GL04_YC_status,
                                                         CG_LT_GL_GL04_LDYL_status=CG_LT_GL_GL04_LDYL_status,
                                                         CG_LT_GL_GL04_RFWD_status=CG_LT_GL_GL04_RFWD_status,
                                                         CG_LT_GL_GL04_RFYL02_status=CG_LT_GL_GL04_RFYL02_status,
                                                         CG_LT_GL_GL04_RFH_status=CG_LT_GL_GL04_RFH_status,
                                                         CG_LT_GL_GL04_FSSJ_status=CG_LT_GL_GL04_FSSJ_status,
                                                         CG_LT_GL_GL04_SBYC_status=CG_LT_GL_GL04_SBYC_status,
                                                         CG_LT_GL_GL04_SBYCZB_status=CG_LT_GL_GL04_SBYCZB_status,
                                                         CG_LT_GL_GL04_SBYC04_status=CG_LT_GL_GL04_SBYC04_status,
                                                         CG_LT_GL_GL04_SBYC03_status=CG_LT_GL_GL04_SBYC03_status,
                                                         CG_LT_GL_GL04_SBYC02_status=CG_LT_GL_GL04_SBYC02_status,
                                                         CG_LT_GL_GL04_SBYC01_status=CG_LT_GL_GL04_SBYC01_status,
                                                         CG_LT_GL_GL04_GLRSZLL_status=CG_LT_GL_GL04_GLRSZLL_status,
                                                         CG_LT_GL_GL04_ZBYCZB_status=CG_LT_GL_GL04_ZBYCZB_status,
                                                         CG_LT_GL_GL04_TQXZS_status=CG_LT_GL_GL04_TQXZS_status,
                                                         CG_LT_GL_GL04_XBYC_status=CG_LT_GL_GL04_XBYC_status,
                                                         CG_LT_GL_GL04_XBYCZB_status=CG_LT_GL_GL04_XBYCZB_status,
                                                         CG_LT_GL_GL04_XBYC01_status=CG_LT_GL_GL04_XBYC01_status,
                                                         CG_LT_GL_GL04_XBYC02_status=CG_LT_GL_GL04_XBYC02_status,
                                                         CG_LT_GL_GL04_XBYC03_status=CG_LT_GL_GL04_XBYC03_status,
                                                         CG_LT_GL_GL04_XBYC04_status=CG_LT_GL_GL04_XBYC04_status,
                                                         CG_LT_GL_GL04_FCokeRate_status=CG_LT_GL_GL04_FCokeRate_status,
                                                         CG_LT_GL_GL04_FCoalRate_status=CG_LT_GL_GL04_FCoalRate_status,
                                                         CG_LT_GL_GL04_RLB_status=CG_LT_GL_GL04_RLB_status,
                                                         CG_LT_GL_GL04_V_status=CG_LT_GL_GL04_V_status,
                                                         CG_LT_GL_GL04_Si_Ti_status=CG_LT_GL_GL04_Si_Ti_status,
                                                         CG_LT_GL_GL04_Ftswd_status=CG_LT_GL_GL04_Ftswd_status,
                                                         CG_LT_GL_GL04_FLiLunTie_status=CG_LT_GL_GL04_FLiLunTie_status)

            return gaolu_reason_status_bo

        except Exception as e:
            current_app.logger.info(e)

    def _get_CG_LT_GL_GL04_COZXFX_status(self, CO):
        if CO < 22.1795:
            status = 1
        elif 22.1795 <= CO < 22.43:
            status = 2
        elif 22.43 <= CO < 24.7:
            status = 3
        elif 24.7 <= CO < 25:
            status = 4
        elif CO > 25:
            status = 5
        else:
            status = 0
        return status

    def _get_CG_LT_GL_GL04_CO2ZXFX_status(self, CO2):
        if CO2 < 20.4300:
            status = 1
        elif 20.4300 <= CO2 < 20.7:
            status = 2
        elif 20.7 <= CO2 < 22.53:
            status = 3
        elif 22.53 <= CO2 < 22.7805:
            status = 4
        elif CO2 > 22.7805:
            status = 5
        else:
            status = 0
        return status

    def _get_CG_LT_GL_GL04_H2ZXZF_status(self, H2):
        if H2 < 3.9995:
            status = 1
        elif 3.9995 <= H2 < 4.09:
            status = 2
        elif 4.09 <= H2 < 5.18:
            status = 3
        elif 5.18 <= H2 < 5.3905:
            status = 4
        elif H2 > 5.3905:
            status = 5
        else:
            status = 0
        return status

    def _get_CG_LT_GL_GL04_N2ZXZF_status(self, N2):
        if N2 < 47.9700:
            status = 1
        elif 47.9700 <= N2 < 48.3:
            status = 2
        elif 48.3 <= N2 < 52.22:
            status = 3
        elif 52.22 <= N2 < 52.6505:
            status = 4
        elif N2 > 52.6505:
            status = 5
        else:
            status = 0
        return status

    # mqlyl 煤气利用率
    def _get_CG_LT_GL_GL04_MQLYL_status(self, mqlyl):
        if mqlyl < 46.3700:
            status = 1
        elif 46.3700 <= mqlyl < 46.659:
            status = 2
        elif 46.659 <= mqlyl < 48.95:
            status = 3
        elif 48.95 <= mqlyl < 49.23:
            status = 4
        elif mqlyl > 49.23:
            status = 5
        else:
            status = 0
        return status

    # bzfs 标准风速
    def _get_CG_LT_GL_GL04_FSBZ_status(self, bzfs):
        if bzfs < 233.8695:
            status = 1
        elif 233.8695 <= bzfs < 235.8700:
            status = 2
        elif 235.8700 <= bzfs < 247.1310:
            status = 3
        elif 247.1310 <= bzfs < 248.5905:
            status = 4
        elif bzfs > 248.5905:
            status = 5
        else:
            status = 0
        return status

    # ldwd1 炉顶温度1
    def _get_CG_LT_GL_GL04_LDWD01_status(self, dwdb):
        if dwdb < 123.9290:
            status = 1
        elif 123.9290 <= dwdb < 130.5830:
            status = 2
        elif 130.5830 <= dwdb < 196.8530:
            status = 3
        elif 196.8530 <= dwdb < 205.4005:
            status = 4
        elif dwdb > 205.4005:
            status = 5
        else:
            status = 0
        return status

    # ldwd2 炉顶温度2
    def _get_CG_LT_GL_GL04_LDWD02_status(self, dwdn):
        if dwdn < 117.8680:
            status = 1
        elif 117.8680 <= dwdn < 124.1980:
            status = 2
        elif 124.1980 <= dwdn < 194.3000:
            status = 3
        elif 194.3000 <= dwdn < 203.3900:
            status = 4
        elif dwdn > 203.3900:
            status = 5
        else:
            status = 0
        return status

    # ldwd3 炉顶温度3
    def _get_CG_LT_GL_GL04_LDWD03_status(self, dwxn):
        if dwxn < 113.4900:
            status = 1
        elif 113.4900 <= dwxn < 120.2870:
            status = 2
        elif 120.2870 <= dwxn < 191.6820:
            status = 3
        elif 191.6820 <= dwxn < 203.0065:
            status = 4
        elif dwxn > 203.0065:
            status = 5
        else:
            status = 0
        return status

    # ldwd4 炉顶温度4
    def _get_CG_LT_GL_GL04_LDWD04_status(self, dwxb):
        if dwxb < 119.0885:
            status = 1
        elif 119.0885 <= dwxb < 126.2390:
            status = 2
        elif 126.2390 <= dwxb < 192.1800:
            status = 3
        elif 192.1800 <= dwxb < 201.0000:
            status = 4
        elif dwxb > 201.0000:
            status = 5
        else:
            status = 0
        return status

    # dw 顶温
    def _get_CG_LT_GL_GL04_DW_status(self, dw):
        if dw < 119.4810:
            status = 1
        elif 119.4810 <= dw < 125.9700:
            status = 2
        elif 125.9700 <= dw < 192.3890:
            status = 3
        elif 192.3890 <= dw < 201.7500:
            status = 4
        elif dw > 201.7500:
            status = 5
        else:
            status = 0
        return status

    # jswd 进水温度
    def _get_CG_LT_GL_GL04_JSWD_status(self, jswd):
        if jswd < 37.9100:
            status = 1
        elif 37.9100 <= jswd < 38.1100:
            status = 2
        elif 38.1100 <= jswd < 39.6000:
            status = 3
        elif 39.6000 <= jswd < 39.6000:
            status = 4
        elif jswd > 39.6000:
            status = 5
        else:
            status = 0
        return status

    # gfdn 鼓风动能
    def _get_CG_LT_GL_GL04_GFDNKG_status(self, gfdn):
        if gfdn < 10782.8715:
            status = 1
        elif 10782.8715 <= gfdn < 11191.4340:
            status = 2
        elif 11191.4340 <= gfdn < 13286.4610:
            status = 3
        elif 13286.4610 <= gfdn < 13498.0710:
            status = 4
        elif gfdn > 13498.0710:
            status = 5
        else:
            status = 0
        return status

    # fyll 富氧流量
    def _get_CG_LT_GL_GL04_FYLL_status(self, fyll):
        if fyll < 7998.4580:
            status = 1
        elif 7998.4580 <= fyll < 8499.8570:
            status = 2
        elif 8499.8570 <= fyll < 12757.3890:
            status = 3
        elif 12757.3890 <= fyll < 12966.3405:
            status = 4
        elif fyll > 12966.3405:
            status = 5
        else:
            status = 0
        return status

    # TfTd T阀T顶
    def _get_CG_LT_GL_GL04_ZXQL_status(self, TfTd):
        if TfTd < 48.5595:
            status = 1
        elif 48.5595 <= TfTd < 50.8490:
            status = 2
        elif 50.8490 <= TfTd < 72.1910:
            status = 3
        elif 72.1910 <= TfTd < 74.3105:
            status = 4
        elif TfTd > 74.3105:
            status = 5
        else:
            status = 0
        return status

    # fzwd 阀座温度
    def _get_CG_LT_GL_GL04_FZWD_status(self, fzwd):
        if fzwd < 72.7790:
            status = 1
        elif 72.7790 <= fzwd < 79.0990:
            status = 2
        elif 79.0990 <= fzwd < 107.0000:
            status = 3
        elif 107.0000 <= fzwd < 110.7620:
            status = 4
        elif fzwd > 110.7620:
            status = 5
        else:
            status = 0
        return status

    # lfll 冷风流量
    def _get_CG_LT_GL_GL04_LFLL_status(self, lfll):
        if lfll < 4863.9480:
            status = 1
        elif 4863.9480 <= lfll < 4903.1390:
            status = 2
        elif 4903.1390 <= lfll < 5126.2310:
            status = 3
        elif 5126.2310 <= lfll < 5152.2110:
            status = 4
        elif lfll > 5152.2110:
            status = 5
        else:
            status = 0
        return status

    # lfyl 冷风压力
    def _get_CG_LT_GL_GL04_LFYL_status(self, lfyl):
        if lfyl < 385.7570:
            status = 1
        elif 385.7570 <= lfyl < 390.0390:
            status = 2
        elif 390.0390 <= lfyl < 405.1600:
            status = 3
        elif 405.1600 <= lfyl < 406.0900:
            status = 4
        elif lfyl > 406.0900:
            status = 5
        else:
            status = 0
        return status

    # yc 压差
    def _get_CG_LT_GL_GL04_YC_status(self, yc):
        if yc < 141.8900:
            status = 1
        elif 141.8900 <= yc < 145.7390:
            status = 2
        elif 145.7390 <= yc < 160.6300:
            status = 3
        elif 160.6300 <= yc < 161.6100:
            status = 4
        elif yc > 161.6100:
            status = 5
        else:
            status = 0
        return status

    # ldyl 炉顶压力
    def _get_CG_LT_GL_GL04_LDYL_status(self, ldyl):
        if ldyl < 235.1200:
            status = 1
        elif 235.1200 <= ldyl < 235.2700:
            status = 2
        elif 235.2700 <= ldyl < 240.0800:
            status = 3
        elif 240.0800 <= ldyl < 240.2300:
            status = 4
        elif ldyl > 240.2300:
            status = 5
        else:
            status = 0
        return status

    # rfwd 热风温度
    def _get_CG_LT_GL_GL04_RFWD_status(self, rfwd):
        if rfwd < 1112.4675:
            status = 1
        elif 1112.4675 <= rfwd < 1127.4490:
            status = 2
        elif 1127.4490 <= rfwd < 1174.6510:
            status = 3
        elif 1174.6510 <= rfwd < 1179.9525:
            status = 4
        elif rfwd > 1179.9525:
            status = 5
        else:
            status = 0
        return status

    # rfyl 热风压力
    def _get_CG_LT_GL_GL04_RFYL02_status(self, rfyl):
        if rfyl < 378.5500:
            status = 1
        elif 378.5500 <= rfyl < 382.9690:
            status = 2
        elif 382.9690 <= rfyl < 398.9810:
            status = 3
        elif 398.9810 <= rfyl < 400.0000:
            status = 4
        elif rfyl > 400.0000:
            status = 5
        else:
            status = 0
        return status

    # rfh 热负荷
    def _get_CG_LT_GL_GL04_RFH_status(self, rfh):
        if rfh < 7913.6670:
            status = 1
        elif 7913.6670 <= rfh < 8640.8130:
            status = 2
        elif 8640.8130 <= rfh < 15332.7740:
            status = 3
        elif 15332.7740 <= rfh < 17672.2635:
            status = 4
        elif rfh > 17672.2635:
            status = 5
        else:
            status = 0
        return status

    # sjfs 实际风速
    def _get_CG_LT_GL_GL04_FSSJ_status(self, sjfs):
        if sjfs < 245.5750:
            status = 1
        elif 245.5750 <= sjfs < 248.9760:
            status = 2
        elif 248.9760 <= sjfs < 266.9400:
            status = 3
        elif 266.9400 <= sjfs < 268.8510:
            status = 4
        elif sjfs > 268.8510:
            status = 5
        else:
            status = 0
        return status

    # sbyc 上部压差
    def _get_CG_LT_GL_GL04_SBYC_status(self, sbyc):
        if sbyc < 19.7995:
            status = 1
        elif 19.7995 <= sbyc < 20.6000:
            status = 2
        elif 20.6000 <= sbyc < 35.4010:
            status = 3
        elif 35.4010 <= sbyc < 36.9610:
            status = 4
        elif sbyc > 36.9610:
            status = 5
        else:
            status = 0
        return status

    # sbyczb 上部压差占比
    def _get_CG_LT_GL_GL04_SBYCZB_status(self, sbyczb):
        if sbyczb < 13.1300:
            status = 1
        elif 13.1300 <= sbyczb < 13.7090:
            status = 2
        elif 13.7090 <= sbyczb < 22.4700:
            status = 3
        elif 22.4700 <= sbyczb < 23.5505:
            status = 4
        elif sbyczb > 23.5505:
            status = 5
        else:
            status = 0
        return status

    # sbyl4 上部压力4
    def _get_CG_LT_GL_GL04_SBYC04_status(self, sbyl4):
        if sbyl4 < 19.2495:
            status = 1
        elif 19.2495 <= sbyl4 < 20.2500:
            status = 2
        elif 20.2500 <= sbyl4 < 35.0000:
            status = 3
        elif 35.0000 <= sbyl4 < 36.5805:
            status = 4
        elif sbyl4 > 36.5805:
            status = 5
        else:
            status = 0
        return status

    # sbyl3 上部压力3
    def _get_CG_LT_GL_GL04_SBYC03_status(self, sbyl3):
        if sbyl3 < 19.8195:
            status = 1
        elif 19.8195 <= sbyl3 < 21.0000:
            status = 2
        elif 21.0000 <= sbyl3 < 36.3120:
            status = 3
        elif 36.3120 <= sbyl3 < 38.3710:
            status = 4
        elif sbyl3 > 38.3710:
            status = 5
        else:
            status = 0
        return status

    # sbyl2 上部压力2
    def _get_CG_LT_GL_GL04_SBYC02_status(self, sbyl2):
        if sbyl2 < 19.0700:
            status = 1
        elif 19.0700 <= sbyl2 < 20.0990:
            status = 2
        elif 20.0990 <= sbyl2 < 35.2200:
            status = 3
        elif 35.2200 <= sbyl2 < 37.0000:
            status = 4
        elif sbyl2 > 37.0000:
            status = 5
        else:
            status = 0
        return status

    # sbyl1 上部压力1
    def _get_CG_LT_GL_GL04_SBYC01_status(self, sbyl1):
        if sbyl1 < 19.6100:
            status = 1
        elif 19.6100 <= sbyl1 < 20.6590:
            status = 2
        elif 20.6590 <= sbyl1 < 35.32:
            status = 3
        elif 35.32 <= sbyl1 < 36.8505:
            status = 4
        elif sbyl1 > 36.8505:
            status = 5
        else:
            status = 0
        return status

    # rszll 软水总流量
    def _get_CG_LT_GL_GL04_GLRSZLL_status(self, rszll):
        if rszll < 3989.6075:
            status = 1
        elif 3989.6075 <= rszll < 4014.8710:
            status = 2
        elif 4014.8710 <= rszll < 4231.9460:
            status = 3
        elif 4231.9460 <= rszll < 4271.7710:
            status = 4
        elif rszll > 4271.7710:
            status = 5
        else:
            status = 0
        return status

    # zbyczb 中部压差占比
    def _get_CG_LT_GL_GL04_ZBYCZB_status(self, zbyczb):
        if zbyczb < 9.6695:
            status = 1
        elif 9.6695 <= zbyczb < 10.0900:
            status = 2
        elif 10.0900 <= zbyczb < 13.8600:
            status = 3
        elif 13.8600 <= zbyczb < 14.8905:
            status = 4
        elif zbyczb > 14.8905:
            status = 5
        else:
            status = 0
        return status

    # tqxzs 透气性指数
    def _get_CG_LT_GL_GL04_TQXZS_status(self, tqxzs):
        if tqxzs < 30.4900:
            status = 1
        elif 30.4900 <= tqxzs < 30.8600:
            status = 2
        elif 30.8600 <= tqxzs < 34.5700:
            status = 3
        elif 34.5700 <= tqxzs < 35.3405:
            status = 4
        elif tqxzs > 35.3405:
            status = 5
        else:
            status = 0
        return status

    # xbyc 下部压差
    def _get_CG_LT_GL_GL04_XBYC_status(self, xbyc):
        if xbyc < 97.7995:
            status = 1
        elif 97.7995 <= xbyc < 100.2090:
            status = 2
        elif 100.2090 <= xbyc < 118.1600:
            status = 3
        elif 118.1600 <= xbyc < 120.3210:
            status = 4
        elif xbyc > 120.3210:
            status = 5
        else:
            status = 0
        return status

    # xbyczb 下部压差占比
    def _get_CG_LT_GL_GL04_XBYCZB_status(self, xbyczb):
        if xbyczb < 63.3595:
            status = 1
        elif 63.3595 <= xbyczb < 64.7500:
            status = 2
        elif 64.7500 <= xbyczb < 75.7000:
            status = 3
        elif 75.7000 <= xbyczb < 76.5105:
            status = 4
        elif xbyczb > 76.5105:
            status = 5
        else:
            status = 0
        return status

    # xbyl1 下部压力1
    def _get_CG_LT_GL_GL04_XBYC01_status(self, xbyl1):
        if xbyl1 < 98.8300:
            status = 1
        elif 98.8300 <= xbyl1 < 101.5190:
            status = 2
        elif 101.5190 <= xbyl1 < 120.1510:
            status = 3
        elif 120.1510 <= xbyl1 < 122.7310:
            status = 4
        elif xbyl1 > 122.7310:
            status = 5
        else:
            status = 0
        return status

    # xbyl2 下部压力2
    def _get_CG_LT_GL_GL04_XBYC02_status(self, xbyl2):
        if xbyl2 < 97.6295:
            status = 1
        elif 97.6295 <= xbyl2 < 99.9300:
            status = 2
        elif 99.9300 <= xbyl2 < 117.7310:
            status = 3
        elif 117.7310 <= xbyl2 < 120.4815:
            status = 4
        elif xbyl2 > 120.4815:
            status = 5
        else:
            status = 0
        return status

    # xbyl3 下部压力3
    def _get_CG_LT_GL_GL04_XBYC03_status(self, xbyl3):
        if xbyl3 < 93.9000:
            status = 1
        elif 93.9000 <= xbyl3 < 97.1800:
            status = 2
        elif 97.1800 <= xbyl3 < 116.9220:
            status = 3
        elif 116.9220 <= xbyl3 < 118.8305:
            status = 4
        elif xbyl3 > 118.8305:
            status = 5
        else:
            status = 0
        return status

    # xbyl4 下部压力4
    def _get_CG_LT_GL_GL04_XBYC04_status(self, xbyl4):
        if xbyl4 < 98.6190:
            status = 1
        elif 98.6190 <= xbyl4 < 101.0880:
            status = 2
        elif 101.0880 <= xbyl4 < 119.4020:
            status = 3
        elif 119.4020 <= xbyl4 < 121.2500:
            status = 4
        elif xbyl4 > 121.2500:
            status = 5
        else:
            status = 0
        return status

    # 焦比
    def _get_CG_LT_GL_GL04_FCokeRate_status(self, FCokeRate):
        if FCokeRate < 328.00:
            status = 1
        elif 328.00 <= FCokeRate < 331.00:
            status = 2
        elif 331.00 <= FCokeRate < 355.00:
            status = 3
        elif 355.00 <= FCokeRate < 362.00:
            status = 4
        elif FCokeRate > 362.00:
            status = 5
        else:
            status = 0
        return status

    # 煤比
    def _get_CG_LT_GL_GL04_FCoalRate_status(self, FCoalRate):
        if FCoalRate < 128.00:
            status = 1
        elif 128.00 <= FCoalRate < 135.00:
            status = 2
        elif 135.00 <= FCoalRate < 162.00:
            status = 3
        elif 162.00 <= FCoalRate < 166.00:
            status = 4
        elif FCoalRate > 166.00:
            status = 5
        else:
            status = 0
        return status

    # rlb 燃料比
    def _get_CG_LT_GL_GL04_RLB_status(self, FRLB):
        if FRLB < 477.00:
            status = 1
        elif 477.00 <= FRLB < 480.00:
            status = 2
        elif 480.00 <= FRLB < 502.00:
            status = 3
        elif 502.00 <= FRLB < 505.00:
            status = 4
        elif FRLB > 505.00:
            status = 5
        else:
            status = 0
        return status

    # [V)
    def _get_CG_LT_GL_GL04_V_status(self, tV):
        if tV < 0.142:
            status = 1
        elif 0.142 <= tV < 0.15098:
            status = 2
        elif 0.15098 <= tV < 0.22302:
            status = 3
        elif 0.22302 <= tV < 0.2308:
            status = 4
        elif tV > 0.2308:
            status = 5
        else:
            status = 0
        return status

    # [Si+Ti)
    def _get_CG_LT_GL_GL04_Si_Ti_status(self, tSiTi):
        if tSiTi < 0.2085:
            status = 1
        elif 0.2085 <= tSiTi < 0.2155:
            status = 2
        elif 0.2155 <= tSiTi < 0.2798:
            status = 3
        elif 0.2798 <= tSiTi < 0.2883:
            status = 4
        elif tSiTi > 0.2883:
            status = 5
        else:
            status = 0
        return status

    # tswd 铁水温度
    def _get_CG_LT_GL_GL04_Ftswd_status(self, tswd):
        if tswd < 1455.00:
            status = 1
        elif 1455.00 <= tswd < 1460.00:
            status = 2
        elif 1460.00 <= tswd < 1478.00:
            status = 3
        elif 1478.00 <= tswd < 1480.00:
            status = 4
        elif tswd > 1480.00:
            status = 5
        else:
            status = 0
        return status

    # lltl 理论铁量
    def _get_CG_LT_GL_GL04_FLiLunTie_status(self, FLiLunTie):
        if FLiLunTie < 253.5095:
            status = 1
        elif 253.5095 <= FLiLunTie < 255.1200:
            status = 2
        elif 255.1200 <= FLiLunTie < 266.22:
            status = 3
        elif 266.22 <= FLiLunTie < 267.36:
            status = 4
        elif FLiLunTie > 267.36:
            status = 5
        else:
            status = 0
        return status

    #
    def _get_CG_LT_GL_GL04_ZBYC_status(self, zbyc):
        if zbyc < 14.8995:
            status = 1
        elif 14.8995 <= zbyc < 15.46:
            status = 2
        elif 15.46 <= zbyc < 21.731:
            status = 3
        elif 21.731 <= zbyc < 23.31:
            status = 4
        elif zbyc > 23.31:
            status = 5
        else:
            status = 0
        return status


# 用导出module的方法创建单例
gaolu_reason_model = GaoLuReasonModel()
